#ifndef TEXTGENERATOR_H
#define TEXTGENERATOR_H

#include "cwgen_global.h"

#include <QObject>
#include <QRegExp>
#include <QFile>
#include <QHash>
#include <QDebug>

class TextGenerator : public QObject
{
    Q_OBJECT
public:
    explicit TextGenerator(QObject *parent = 0);
    explicit TextGenerator(const QString &file, QObject *parent = 0);
    QString getText() const;
    
signals:
    void newSimbol(const QString &simbol);
    
public slots:
    void setSourceSimbols(const QString &source);
    void loadSourceFromFile(const QString &file);
    void setSimbolsOnGroup(uint cnt = 5);
    void setGroupCount(uint cnt = 25);
    void generate();
    void clear();

private:
    uint sCnt, gCnt;
    QHash<int,QString> _simbols;
    QString _out;
};

#endif // TEXTGENERATOR_H
